const { defineConfig } = require("@vue/cli-service");
const path = require("path");
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  runtimeCompiler: true,
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [path.resolve(__dirname, "./src/styles/antd.less")],
    },
  },
  chainWebpack: (config) => {
    config.plugin("monaco-editor").use(new MonacoWebpackPlugin());
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true,
        },
      },
    },
  },
  devServer: {
    proxy: {
      [process.env.VUE_APP_BASE_URL]: {
        target: `http://rap2api.taobao.org/`,
        pathRewrite: { [process.env.VUE_APP_BASE_URL]: "" },
      },
    },
  },
});
